package eighthwork.one;

import javax.swing.*;

/**
 * @author ：chenzikang
 * @date ： 2020/4/7
 */

public class ExceptionTest {
    public static void main(String[] args) {

        try{
            String word[]={"good","bad","ok","bye"};
            String s= JOptionPane.showInputDialog("输入一个数");
            int n=Integer.parseInt(s);
            System.out.println(word[n]);
        }catch (ArrayIndexOutOfBoundsException e){
            System.out.println("超出内容");
        }

    }
}
